package collectionDemo;

import apple.laf.JRSUIUtils;
import com.alibaba.fastjson2.function.impl.ToString;

import java.util.Objects;

/**
 *@Author:fengxiaohui
 *@Description:
 *@Date:Create in 22:37 2025/1/7
 *@Modified By:
 */
public class TreeNode {
    private int value;
    private TreeNode next;

    public TreeNode(int value){
        this.value = value;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;
        TreeNode treeNode = (TreeNode) o;
        return value == treeNode.value && Objects.equals(next, treeNode.next);
    }

    @Override
    public int hashCode() {
        return Objects.hash(value, next);
    }

    @Override
    public String toString() {
        return "TreeNode{" +
                "value=" + value +
                ", next=" + next +
                '}';
    }
}
